// 引入二次封装的axios
import request from '@/utils/request'

// 获取采购订单
export function get() {
  return request({
    url: '/admin/product/pOrder/get',
    method: 'get'
  })
}
// 获取品牌列表
export function getGoods() {
  return request({
    url: '/admin/product/pOrder/getGoods',
    method: 'get'
  })
}
// 获取供应商列表
export function getSupplier() {
  return request({
    url: '/admin/product/supplier/get',
    method: 'get'
  })
}
// 获取采购订单id
export function getId() {
  return request({
    url: '/admin/product/pOrder/getId',
    method: 'get'
  })
}
// 获取货物单位
export function getUnit(id) {
  return request({
    url: `/admin/product/pOrder/getUnit/${id}`,
    method: 'get'
  })
}
// 保存采购订单
export function add(id, date, salesperson, data) {
  return request({
    url: `/admin/product/pOrder/add/${id}/${date}/${salesperson}`,
    method: 'post',
    data
  })
}
// 取消采购订单
export function cancel(id) {
  return request({
    url: `/admin/product/pOrder/cancel/${id}`,
    method: 'delete'
  })
}
